织梦cms

推荐列表 站点导航

当前位置:首页 > 建站教程 > 织梦cms >

拓展channel标签实现limit功能

来源:网络整理  作者:  发布时间:2020-12-15 06:29
由于网站栏目多次需要调用同一栏目下的栏目比如顶级栏目6 下级栏目5.4.3.2.1 需要分两次分别调出543和21 感觉channel就...

{

--------------------------------------------------------------------------------

    $line = empty($row) ? 100 : $row;

        $orwhere = join(' And ',$orwheres);

 

 

 

    if($orwhere!='') $orwhere = " where $orwhere ";//二次开发

    else $limitsql = " limit 0,7 ";

    $limit = trim(eregi_replace('limit','',$limit));

        $orwhere = ereg_replace("And[ ]{1,}And",'And ',$orwhere);

 

    FillAttsDefault($ctag->CAttribute->Items,$attlist);

----------------------------------------------------------

//limit条件

    if(isset($orwheres[0])) {

所有查询条件的limit 0,$row改为$limitsql OK 保存

由于网站栏目多次需要调用同一栏目下的栏目比如顶级栏目6 下级栏目5.4.3.2.1 需要分两次分别调出543和21 感觉channel就比较吃力了全部写SQL又太多,可能是我还不知道有其他方法吧。row调用不出这种效果所以就把row改为了Limit用法了比较方便 修改文件include\taglib/下面的channel.lib.php 在函数lib_channel里面加上

    global $dsql;

把上面的代码,添加到函数lib_channel(具体位置为:)

function lib_channel(&$ctag,&$refObj)

        $orwhere = ereg_replace("^ And",'',$orwhere);

 

    }

    if($limit!='') $limitsql = " limit $limit ";

    extract($ctag->CAttribute->Items, EXTR_SKIP);

 

 

    $innertext = $ctag->GetInnerText();

 

    $attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";

    $orwhere = '';

这段代码后面

相关热词: 功能 标签

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jz/dedecms/4038.shtml

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

拓展channel标签实现limit功能

2020-12-15 编辑:

{

--------------------------------------------------------------------------------

    $line = empty($row) ? 100 : $row;

        $orwhere = join(' And ',$orwheres);

 

 

 

    if($orwhere!='') $orwhere = " where $orwhere ";//二次开发

    else $limitsql = " limit 0,7 ";

    $limit = trim(eregi_replace('limit','',$limit));

        $orwhere = ereg_replace("And[ ]{1,}And",'And ',$orwhere);

 

    FillAttsDefault($ctag->CAttribute->Items,$attlist);

----------------------------------------------------------

//limit条件

    if(isset($orwheres[0])) {

所有查询条件的limit 0,$row改为$limitsql OK 保存

由于网站栏目多次需要调用同一栏目下的栏目比如顶级栏目6 下级栏目5.4.3.2.1 需要分两次分别调出543和21 感觉channel就比较吃力了全部写SQL又太多,可能是我还不知道有其他方法吧。row调用不出这种效果所以就把row改为了Limit用法了比较方便 修改文件include\taglib/下面的channel.lib.php 在函数lib_channel里面加上

    global $dsql;

把上面的代码,添加到函数lib_channel(具体位置为:)

function lib_channel(&$ctag,&$refObj)

        $orwhere = ereg_replace("^ And",'',$orwhere);

 

    }

    if($limit!='') $limitsql = " limit $limit ";

    extract($ctag->CAttribute->Items, EXTR_SKIP);

 

 

    $innertext = $ctag->GetInnerText();

 

    $attlist = "typeid|0,reid|0,row|100,col|1,type|son,currentstyle|,cacheid|";

    $orwhere = '';

这段代码后面

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jz/dedecms/4038.shtml

相关文章

风云图片

推荐阅读

返回织梦cms频道首页